<?php
/**
 * RedCross Application
 *
 * @copyright Copyright (c) 2010, Kristian Stokke Tryggestad, Rune Vikestad, Andreas Flaten Wist, Simen Nicolai Echholt, Ole Henrik Jahren
 */

/**
 * Form for adding a new passive message
 *
 * @category    RedCross
 * @package     Core_Form
 */
class Core_Form_Passive_Add extends RedCross_Form
{

	const DATE_FORMAT = 'dd.MM.YYYY';
	
    public function init()
    {
    	$this->addElement('hidden','member_id');
    	
        $this->addElement('text', 'from_date', array(
			'required'      => true,
			'label'         => 'Starttidspunkt (f.o.m.)'
		));
        
		$this->addElement('text', 'to_date', array(
			'required'      => false,
			'label'         => 'Slutttidspunkt (t.o.m.)'
		));
		
		$this->addElement('submit','submit', array('label' => 'Legg til'));
    }

    public function fillForm(array $data)
    {
    	foreach ($data as $id => $value)
    	{
    		$this->getElement($id)->setValue($value);
    	}
    }
}